/********************************************************************
* Copyright (c) 2013,TGS,All rights reserved.
* fileName:	MapToolSelectRctangle.h	
* created:	2013/08/07 15:52

* version:	1.6
* detail: 
*********************************************************************/

#pragma once


#include <QRect>
#include "MapTool.h"

class QPoint;
class QMouseEvent;

namespace TGS{
namespace MapControl{

class MapCanvas;
class RubberBand;


class MapToolSelectRectangle : public MapTool
{
public:
    MapToolSelectRectangle( MapCanvas* canvas );
public:
    //! Overridden mouse move event
    virtual void canvasMoveEvent( QMouseEvent * e );

    //! Overridden mouse press event
    virtual void canvasPressEvent( QMouseEvent * e );

    //! Overridden mouse release event
    virtual void canvasReleaseEvent( QMouseEvent * e );
private:
	 void setRubberBand(MapCanvas* canvas, QRect& selectRect,RubberBand* rubberBand );
private:
    //! Flag to indicate a map canvas drag operation is taking place
    bool _dragging;
    //! stores actual select rect
    QRect _selectRect;

    RubberBand* _rubberBand;
};


}//MapControl
}//TGS